//
// Created by chenxp on 2025/8/24.
//

#pragma once

#include <QPushButton>

class ToggleButton : public QPushButton {
    Q_OBJECT
    Q_PROPERTY(bool isGreen READ isGreen WRITE setIsGreen NOTIFY isGreenChanged)

public:
    explicit ToggleButton(QWidget *parent = nullptr);

    bool isGreen() const { return m_isGreen; }
    void setIsGreen(bool value);

    signals:
        // 声明信号
        void isGreenChanged(bool newValue);

    private slots:
        void handleClicked();

private:
    void updateStyle();
    bool m_isGreen = true;
};

